/*
 * @Author: DUST
 * @Date: 2023-05-16 14:46:25
 * @LastEditors: DUST
 * @LastEditTime: 2024-01-20 11:26:18
 * @FilePath: \business-card-system\admin\src\api\index.ts
 * @Description:
 * undefined
 */
import { PageInterFace } from "@/interface";
import Axios from "@/utils/Axios";

/**
 * @description: 获取笔记数据
 * @param {PageInterFace} params：接口参数
 */
export const notePage = async (params: PageInterFace) => {
  return await Axios(`/note/page`, { params });
};
export const addNote = async (params: any) => {
  return await Axios.post(`/note/add`, params);
};
export const editNote = async (params: any) => {
  return await Axios.put(`/note/edit`, params);
};
export const delNote = async (params: any) => {
  return await Axios.delete(`/note/delete/${params.id}`);
};
export const tagsLIst = async () => {
  return await Axios(`/tags/list`);
};
export const addTagApi = async (params: any) => {
  return await Axios.post(`/tags/add`, params);
};
export const editTagApi = async (params: any) => {
  return await Axios.put(`/tags/edit`, params);
};
export const delTagApi = async (params: any) => {
  return await Axios.delete(`/tags/delete/${params.id}`);
};
// 登录获取token
export const getToken = async (params: any) => {
  return await Axios.post(`/login/token`, params);
};
// 获取用户信息
export const getInfo = async (id: number) => {
  return await Axios.post(`/login/info/${id}`, id);
};
// 新增导航类型
export const addNavigateType = async (params: { name: string }) => {
  return await Axios.post(`/navigate/add`, params);
};
// 网站类型列表
export const websiteTypeList = async () => {
  return await Axios(`/navigate/list`);
};
// 新增网站
export const addWebsite = async (params: any) => {
  return await Axios.post(`/website/add`, params);
};
// 编辑网站
export const editWebsite = async (params: any) => {
  return await Axios.put(`/website/edit`, params);
};
// 网站分页数据
export const websitePage = async (params: PageInterFace) => {
  return await Axios(`/website/list`, { params });
};
// 网站分页数据
export const deleteWebsite = async (id: number) => {
  return await Axios.delete(`/website/delete/${id}`);
};
// 新增名片人员
export const addBusinessCardUser = async (params: any) => {
  return await Axios.post(`/businessCardUser/add`, params);
};
// 编辑名片人员
export const editBusinessCardUser = async (params: any) => {
  return await Axios.put(`/businessCardUser/edit`, params);
};
// 名片人员分页数据
export const businessCardUserPage = async (params: PageInterFace) => {
  return await Axios(`/businessCardUser/page`, { params });
};
// 删除名片人员信息
export const deleteBusinessCardUser = async (id: number) => {
  return await Axios.delete(`/businessCardUser/delete/${id}`);
};

// 新增公司信息
export const addCompany = async (params: any) => {
  return await Axios.post(`/company/add`, params);
};
// 编辑公司信息
export const editCompany = async (params: any) => {
  return await Axios.put(`/company/edit`, params);
};
// 公司信息分页数据
export const companyInfoAPi = async (unitId: number) => {
  return await Axios(`/company/info/${unitId}`);
};
// 公司地址列表
export const companyAddListAPi = async (unitId: number) => {
  return await Axios(`/company/addlist/${unitId}`);
};

// 修改密码
export const changePassowrd = async (params: any) => {
  return await Axios.put(`/login/change/password`, params);
};
